package com.hhsjtest.bus_spec.itemdata

import android.view.Gravity
import com.hhsjdesign.dynamicui.core.property.item.ImageViewProperty
import com.hhsjdesign.dynamicui.core.property.item.TextViewProperty
import com.hhsjdesign.dynamicui.core.property.ViewBaseProperty
import com.hhsjdesign.dynamicui.core.property.viewdata.ItemViewData

/**
 * 本地实现好的类，以及数据
 */
class EnterItemWidgetData10001 : ItemViewData {

    constructor() {
        //root0
        this.name = "frame1"
        this.type = "frame"
        this.deep = 0
        this.property = ViewBaseProperty().apply {
            this.padding[0] = 0
            this.gravity = Gravity.CENTER
        }

        this.treeList = ArrayList()

        //imageBy1
        this.treeList!!.add(ItemViewData().apply {
            this.name = "image2"
            this.type = "image"
            this.deep = 1
            this.property = ImageViewProperty(1, "bgUrl")
        })

        //linearlayout1
        this.treeList!!.add(ItemViewData().apply {

            this.name = "linear3"
            this.type = "linear_h"
            this.deep = 1
            this.property = ViewBaseProperty().apply {
                this.gravity = Gravity.CENTER_VERTICAL
            }

            this.treeList = ArrayList()
            //icon2
            this.treeList!!.add(ItemViewData().apply {
                this.name = "image4"
                this.type = "image"
                this.deep = 2
                this.property = ImageViewProperty(1, "icon")
            })

            //linearlayout2
            this.treeList!!.add(ItemViewData().apply {
                this.name = "linear5"
                this.type = "linear_v"
                this.deep = 2
                this.property = ViewBaseProperty().apply {
                    gravity = Gravity.CENTER_VERTICAL
                }

                //text title3
                this.treeList!!.add(ItemViewData().apply {
                    this.name = "text6"
                    this.type = "text"
                    this.deep = 3
                    this.property = TextViewProperty(14f, 0xff333333.toInt(), "title")
                })

                //text desc3
                this.treeList!!.add(ItemViewData().apply {
                    this.name = "text7"
                    this.type = "text"
                    this.deep = 3
                    this.property = TextViewProperty(14f, 0xff999999.toInt(), "desc")
                })
            })
        })
    }
}